﻿Imports System.Windows.Forms

Public Class frmFindFile

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    ''' <summary>
    ''' Radio buttons don't support double-click event, so do it manually
    ''' </summary>
    Private Sub opt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles optOrig.Click, optRel.Click, optLocal.Click, optBrowse.Click
        Static lastClickTime As DateTime = DateTime.MinValue, lastControl As Object = Nothing
        If lastControl Is sender And DateTime.Now.Subtract(lastClickTime).TotalMilliseconds <= SystemInformation.DoubleClickTime Then
            OK_Button.PerformClick()
        End If
        lastClickTime = DateTime.Now
        lastControl = sender
    End Sub
End Class
